package com.cloudm.technician.data.db

import com.cloudm.technician.data.model.ImageInfo
import com.cloudm.technician.data.model.User
import io.realm.RealmResults

/**
 * 作者: wesley
 * 时间: 2017/11/20
 * 描述: 数据库相关的接口
 */
interface DbHelper {

    fun insertOrUpdateUser(user: User)

    fun queryUserInfoByToken(token: String?): User?

    fun updateUserNickName(user: User?, name: String)

    fun updateUserLogo(user: User?, logo: String)

    fun queryLocalImage(token: Int, tag: Int, deviceId: Int): ArrayList<ImageInfo>

    fun queryAllImageInfoByDeviceId(token: Int, tag: Int, deviceId: Int): RealmResults<ImageInfo>

    fun insertOrUpdateImageInfo(list: ArrayList<ImageInfo>)

    fun updateLocalImage(token: Int, tag: Int, deviceId: Int, position: Int, url: String, flag: Int)

    fun clearLocalImage(token: Int, tag: Int, deviceId: Int)

    fun deleteAllData()
}